package com.hulk.dryad.persistence.entity;

import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;

import com.hulk.dryad.common.annotation.Sensitive;
import com.hulk.dryad.common.jackson.sensitive.SensitiveTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author hulk
 * @since 2020-09-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ToString(callSuper = true)
@TableName("t_customer_operator")
public class CustomerOperator extends SuperEntity<CustomerOperator> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField("operator_no")
    private String operatorNo;

    @TableField("operator_name")
    private String operatorName;

    @TableField("avatar")
	@ToString.Exclude
    private String avatar;

    /**
     * M-男性；F-女性；N-未知
     */
    @TableField("gender")
    private String gender;

    @TableField("nick_name")
    private String nickName;

    /**
     * 间习-NOVICE 精英-ELITE 大师-MASTER 领袖-LEADER
     */
    @TableField("operator_lvl")
    private String operatorLvl;

	@Sensitive(type = SensitiveTypeEnum.PASSWORD)
	@ToString.Exclude
    @TableField("login_pwd")
    private String loginPwd;

    /**
     * 不建议二进制方式存储，数据迁移不方便。
     */
	@ToString.Exclude
	@JsonIgnore
    @TableField("login_salt")
    private String loginSalt;

    /**
     * SS-申述禁止 AQ-安全禁止
     */
    @TableField("forbidden_login_reason")
    private String forbiddenLoginReason;

    /**
     * Y-已经认证；N-未认证；
        描述该操作员是否通过认证；
        只有操作员发起认证，且通过的情况；
        或者操作员发起关联认证通过后，该状态才改为Y，否则均为N；
        默认未认证
     */
    @TableField("realname_status")
    private String realnameStatus;

    @TableField("last_login_success_time")
    private LocalDateTime lastLoginSuccessTime;

    @TableField("last_login_fail_time")
    private LocalDateTime lastLoginFailTime;

    @TableField("login_pwd_lock_num")
    private Integer loginPwdLockNum;

    @TableField("login_pwd_lock_date")
    private LocalDate loginPwdLockDate;

    @TableField("last_pwd_modify_time")
    private LocalDateTime lastPwdModifyTime;

    @TableField("last_login_ip")
    private String lastLoginIp;

    @TableField("auth_time")
    private LocalDateTime authTime;

    /**
     * 用每一位来表示不同的冻结状态
        BIT1：申述冻结
        BIT2：
        增加多操作员冻结
     */
    @TableField("stsword")
    private String stsword;

    @TableField("identity")
    private String identity;

    /**
     * NORMAL-自然流入
        RECOMMEND-好友推荐
        REPLACEREG-代注册
     */
    @TableField("data_source_type")
    private String dataSourceType;

    /**
     * USER-用户前台
        SYS-系统内部
        WORK-工作平台
        ALL-所有
     */
    @TableField("login_right_range")
    private String loginRightRange;

    /**
     * NORMAL-正常
        FREEZE-冻结
        LOCK-锁定
        FORBIDDEN-禁止登陆
        INACTIVE-未激活
     */
    @TableField("operator_status")
    private String operatorStatus;

    @TableField("archived_by")
    private String archivedBy;

    @TableField("archived_time")
    private LocalDateTime archivedTime;

    /**
     * 0-未归档 1-已归档(注销账户)（enabled)
     */
	@TableLogic
    @TableField("archived_flag")
    private String archivedFlag;

    /**
     * N-未锁定 Y-已锁定(accountNonLocked)
     */
    @TableField("locked_flag")
    private String lockedFlag;

    @TableField("locked_time")
    private LocalDateTime lockedTime;

    /**
     * accountNonExpired
     */
    @TableField("expire_date")
    private LocalDate expireDate;

    /**
     * credentialsNonExpired
     */
    @TableField("credentials_expire_date")
    private LocalDate credentialsExpireDate;

    /**
     * CUSTOMER客户填写 SYSTEM系统生成
     */
    @TableField("pwd_create_type")
    private String pwdCreateType;

    /**
     * N-不需要重置 Y-需要重置
     */
    @TableField("pwd_reset_flag")
    private String pwdResetFlag;


    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

	@TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

	@TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime updatedTime;

	@TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    @TableField("ori_id")
    private String oriId;

    @TableField("rsv1")
    private String rsv1;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
